package com.enhe.gck.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import com.enhe.gck.CarbonRelationType;
import com.kuangkie.carbon.record.Updatable;
import com.kuangkie.carbon.record.annotation.Attribute;
import com.kuangkie.carbon.record.annotation.CarbonRecord;
import com.kuangkie.carbon.record.annotation.RecordCode;
import com.kuangkie.carbon.record.annotation.Relation;
import com.kuangkie.carbon.uid.model.UidManager;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

// 装车批次记录
@Data
@CarbonRecord("hwane20782")
public class LoadingBatchRecord implements Updatable {
    @JSONField(name = "唯一编码")
    @RecordCode
    private Long id = UidManager.getLongUID();

    // 批次号
    @JSONField(name = "批次号")
    @Attribute("hwan20786")
    private String batchNumber;

    // 品种ID
    @JSONField(name = "品种ID")
    @Attribute("hwan20787")
    private String categoryId;

    // 品种名
    @JSONField(name = "品种名")
    @Attribute("hwan20788")
    private String categoryName;

    // 数量
    @JSONField(name = "数量")
    @Attribute("hwan20789")
    private BigDecimal quantity;

    // 装车道号
    @JSONField(name = "装车道号")
    @Attribute("hwan20790")
    private String laneNo;

    // 装车道名称
    @JSONField(name = "装车道名称")
    @Attribute("hwan20791")
    private String laneName;

    // 装车开始时间
    @JSONField(name = "装车开始时间")
    @Attribute("hwan20792")
    private LocalDateTime loadStartTime;

    // 装车结束时间
    @JSONField(name = "装车结束时间")
    @Attribute("hwan20793")
    private LocalDateTime loadEndTime;

    // 扣除顺序
    @Attribute("hwan20798")
    private Integer deductionSequence;

    // 命令参数
    @Attribute("hwan20850")
    private Long commandParameters;

    @Relation(CarbonRelationType.RR_装车批次记录_装车批次记录所属销售订单_订单记录)
    private Long orderId;

    @Override
    public String getRecordCode() {
        return this.id == null ? null : this.id.toString();
    }
}